//贪心 前缀和 训练士兵
//这个方法时间复杂度太高，只能过百分之40
//因为在计算组团训练次数的时候，采取的是暴力遍历的方法
#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;

const ll N = 1e5 + 9;
pair<ll, ll> pairs[N];
ll prefix[N];
int main()
{
	ll n = 0, S = 0;
	cin >> n >> S;
	
	for (ll i = 1; i <= n; i++)
	{
		cin >> pairs[i].second >> pairs[i].first;
	}
	
	sort(pairs + 1, pairs + 1 + n);
	
	for (ll i = 1; i <= n; i++)
	{
		prefix[i] = prefix[i - 1] + pairs[i].second;
	}
	
	ll ans = 0;
	ll i = 0;
	for (i = 1; i <= n; i++)
	{
		if (prefix[n] - prefix[i - 1] >= S)
		{
			ll tmp = pairs[i].first;
			while (tmp > 0)
			{
				for (ll j = 1; j <= n; j++)
				{
					(pairs[j].first)--;
				}
				ans += S;
				tmp--;
			}
		}
		else
		{
			break;
		}
	}
	
	for (; i <= n; i++)
	{
		ans += pairs[i].first * pairs[i].second;
	}
	cout << ans;
	return 0;
	
}
